home *** CD-ROM | disk | FTP | other *** search
- Path: news.sprintlink.net!datalytics!usenet
- From: Rob Stewart <stew@datalytics.com>
- Newsgroups: comp.lang.c++
- Subject: Re: What are the differences between structures and classes in C++ ?
- Date: Mon, 08 Apr 1996 15:39:58 -0400
- Organization: Datalytics, Inc
- Message-ID: <31696B8E.6461@datalytics.com>
- References: <4k5m65$av@hpscit.sc.hp.com> <DpG53J.Hsz@presby.edu> <4k83j3$a56@hpscit.sc.hp.com> <marnoldDpHvED.E0t@netcom.com>
- NNTP-Posting-Host: 204.62.224.71
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (WinNT; I)
-
- Matt Arnold wrote:
- >
- > Raghuveera Ravinutala <raghur> writes:
- >
- > ><jtbell@presby.edu (Jon Bell)> wrote :
- > >>the only *formal* difference between a class and a
- > >>struct is that by default, class members are private whereas struct
- > >>members are public.
- >
- > >Thanx. I am aware of this difference. I would like to know more, like,
- > >inheritence etc..
- >
- > There is none, other the default protection state of members. [snip]
- > Structs can inherit from other structs and classes and can be inherited
- > by other structs and classes. Structs can have virtual functions, member
- > operators, constructors and destructors, you can create template structs,
- > and so on.
- >
- > In other words, structs *are* classes.
- >
-
- Actually, classes *are* structs, since struct came first. Early
- debuggers would also reveal this (at least dbx on the UNIX side
- did). What you declared a class the debugger revealed as a
- struct.
-
- --
- Robert Stewart | My opinions are usually my own.
- Datalytics, Inc. | stew@datalytics.com
-